import type { VxeTableGridOptions } from '#/adapter/vxe-table';

import { DICT_TYPE } from '@vben/constants';

import { $t } from '#/locales';

/** 联系人明细列表列配置 */
export function useDetailListColumns(): VxeTableGridOptions['columns'] {
  return [
    {
      type: 'checkbox',
      width: 50,
      fixed: 'left',
    },
    {
      field: 'name',
      title: $t('views.crm.contact.name'),
      fixed: 'left',
      slots: { default: 'name' },
    },
    {
      field: 'customerName',
      title: $t('views.crm.contact.customerName'),
      fixed: 'left',
      slots: { default: 'customerName' },
    },
    {
      field: 'sex',
      title: $t('views.crm.common.sex'),
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.SYSTEM_USER_SEX },
      },
    },
    {
      field: 'mobile',
      title: $t('views.crm.common.mobile'),
    },
    {
      field: 'telephone',
      title: $t('views.crm.common.telephone'),
    },
    {
      field: 'email',
      title: $t('views.crm.common.email'),
    },
    {
      field: 'post',
      title: $t('views.crm.common.post'),
    },
    {
      field: 'detailAddress',
      title: $t('views.crm.common.detailAddress'),
    },
    {
      field: 'master',
      title: $t('views.crm.contact.master'),
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING },
      },
    },
  ];
}
